<?php
namespace api\tests;
use api\tests\FunctionalTester;
use Codeception\Util\HttpCode;
use common\models\ArchiveDiary;
class TCest
{
    public function _before(FunctionalTester $I)
    {
    }

    public function _after(FunctionalTester $I)
    {
    }




    // tests
    public function test单条查询(FunctionalTester $I)
    {
        $I->sendAjaxGetRequest(['v1/diaries','id'=>415]);
        $I->seeResponseCodeIs(200);
        $I->seeResponseContains('"title":"学骑自行车"');
        $data = $I->grabResponse();
        $I->seeResponseContainsJson(['title'=>"学骑自行车"]);
//        var_dump($data);die;
//        $I->sendAjaxGetRequest(['v1/diaries','id'=>416]);
//      $I->seeResponseCodeIs(HttpCode::OK);
//        $data = $I->grabResponse();
//        $I->sendAjaxGetRequest('v1/abc');
//        $I->seeResponseCodeIs(HttpCode::NOT_FOUND);
//        var_dump($data);die;
//        $diary = $I->grabRecord(ArchiveDiary::className(),['id'=>416]);
//        expect_that(is_null($diary));
//        var_dump($I->grabResponse());die;



    }
    public function test编辑观察日志(FunctionalTester $I)
    {

    }
}
